//
//  OUserRegLogic.m
//  soccer
//
//  Created by 上官千城 on 15/9/18.
//  Copyright (c) 2015年 上官千城. All rights reserved.
//

#import "OUserRegLogic.h"
#import "OHttp.h"


@implementation OUserRegLogic

-(void) request
{
    NSDictionary* params = @{
        @"account":self.account,
        @"pwd":self.pwd,
        @"phone":self.phone,
        @"productId":self.protuctId
    };
    [self send:params];
}


-(void) run:(NSData *)data erc:(NSInteger)erc
{
    if (erc != SUCC) {
        //TODO:fail logic process;
        NSString *str = [NSString stringWithFormat:@"登录失败erc= %ld",erc];
        UIAlertView *failAlert = [[UIAlertView alloc] initWithTitle:@"提示" message:str delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
        [failAlert show];
        return;
    }
    
    NSDictionary* dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
    
    NSLog(@"reg succ data=%@",dic);
    //TODO:succ logic process;
   /* if (muDelegate) {
        muDelegate(self);
    }*/
    [self mu];
}

@end
